<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        
        <%@page import="java.util.*"%>
        <%@page import="edu.byu.isys413.group1E.handlers.*"%>
        <%@page import="edu.byu.isys413.group1E.data.*"%>
        <%@page import="java.util.ArrayList.*"%>
        <%@page import="java.text.DecimalFormat"%>
       <%@page import="java.text.NumberFormat;"%>
        
        
        
        <%   
        ArrayList<ForRentBO> rentalCatalog = (ArrayList<ForRentBO>)request.getAttribute("rentalCatalog");
        DecimalFormat fmt = new DecimalFormat();
        fmt.setMinimumFractionDigits(2);
        fmt.setMaximumFractionDigits(2);    
        NumberFormat currencyFormat = NumberFormat.getCurrencyInstance();
        %>
        
        
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>MyStuff Rental Catalog</title>
        <style type="text/css">
            <!--
body,td,th {
	font-family: tahoma;
}
body {
	background-color: #354153;
}
.title {background-color: #708BB2; 
color:#FFFFFF; padding:5px; 
font-size:12px; 
font-weight:bold; 
border:1px solid; 
width:492px;
}
.tablething {border-collapse:collapse; color:#FFFFFF; font-size:10px; border-top:0px; border-left:2px solid;
}
.add
{
background-image:url(images/add.gif); 
width:12px; 
height:12px; 
border:0px; 
padding:0px; 
margin:0px;
}
            -->
    </style></head>
    
    <body>
        <div class="title">
            <table border="0" cellspacing="0" cellpadding="3" style="padding:0px;" width="100%">
                <tr>
                    <td width="25"><img src="images/product.gif" width="25" height="23" /></td>
                    <td width="197">MyStuff Rental Catalog </td>
                    <form method="get" action="edu.byu.isys413.actions.searchRental.action">
                        <td width="211" align="right">				
                            <select name="category" style="font-size:10px; border:0px; width:120px;">
                                <option selected="selected">All Categories</option>
                                <option>Camera</option>
                                <option>Compact Point and Shoot</option>
                                <option>DSLR</option>
                            </select>  
                            <input name="query" type="text"  size="12"  style="font-size:11px;">
                        </td>					<td width="35" align="right">
                        <input name="submit" type="submit" value="Search"  style="font-size:10px; width:45px" /></td>
                    </form>
                </tr>
            </table>
        </div>
        <div style="background-image:url(images/camera.jpg); background-position:center; background-repeat:no-repeat; border-color:#FFFFFF; height:340px; width:502px; overflow:auto; border:1px solid; border-color:#FFFFFF; " align="right">
            
            <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolor="#FFFFFF"  class="tablething" style="border:0px; border-bottom:1px solid; border-color:#FFFFFF; border-top:0px;">
                
                
                <tr style="font-weight:bold; background-color:#000066">
                    <td>Category</td>
                    <td>Item</td>
                    <td>Description</td>
                    <td width="30" align="right">Days</td>
                    <td width="30" align="right">$/day</td>
                    <td width="10"></td>
                </tr>
                
                
                <%for(int counter = 0; counter<rentalCatalog.size(); counter++) {   %>
                
                <tr><form id="additem<%=counter%>" name="additem<%=counter%>" method="post" target="cart" action="edu.byu.isys413.actions.rentCheckout.action">
                        <td><%=rentalCatalog.get(counter).getConceptual().getCategory()%></td>
                        <td><%=rentalCatalog.get(counter).getConceptual().getProductName()%></td>
                        <td><%=rentalCatalog.get(counter).getConceptual().getDescription()%></td>
                        <td width="30" align="right">
                            <select name="days" style="font-size:10px; border:0px;">
                                <option selected="selected">1</option>
                                <option>2</option>
                                <option>3</option>
                                <option>4</option>
                                <option>5</option>
                                <option>6</option>
                                <option>7</option>
                                <option>8</option>
                                <option>9</option>
                                <option>10</option>
                        </select>      </td>
                        <td width="30" align="right"><%=currencyFormat.format(((RntlHandler.getInstance().getConcepRentalByPhyProdID(rentalCatalog.get(counter).getProductID())).getPricePerDay()))%></td>
                            <td width="10">
                            <input type="hidden" name="SKU"   value="<%=rentalCatalog.get(counter).getSKU()%>"/>
                            <input type="submit" name="Submit" value=""  class="add" />	 
                        </td>
                </form> </tr>
                <% }//end for Loop    %>
            </table>
        </div>
    </body>
</html>
